function scroll(event) {
        if (event.wheelDelta > 0) //wheel up
                navigationList(SLIDE_RIGHT);
        else
                navigationList(SLIDE_LEFT);
}

function navigationList(event) {
        var selectedDiv = document.getElementById('listItemSelected');

        var e = event || window.event;
        var code = e.keyCode || e;

        switch (code) {
                case SLIDE_LEFT:
                        var newDiv = selectedDiv.nextSibling;

                        if (newDiv === null) {//bottom reachted
                                if (currendIndex < listContents.length-1) {//is there a next element?
                                        currendIndex++;
                                        var startIndex = currendIndex - (currendIndex % entriesPerPage);
                                        var endIndex = Math.min(listContents.length, startIndex+entriesPerPage);
                                        injectListContents(funcName);
                                }
                        }
                        else {
                                currendIndex++;
                                selectedDiv.id = '';
                                newDiv.id = 'listItemSelected';
                        }
                        break;
                case SLIDE_RIGHT:
                        var newDiv = selectedDiv.previousSibling;

                        if (newDiv === null) {//upper bound reached
                                if (currendIndex > 0) {//is there a previous element?
                                        currendIndex--;
                                        var startIndex = currendIndex - (currendIndex % entriesPerPage);
                                        var endIndex = Math.min(listContents.length, startIndex+entriesPerPage);
                                        injectListContents(funcName);
                                }
                        }
                        else {
                                currendIndex--;
                                selectedDiv.id = '';
                                newDiv.id = 'listItemSelected';
                        }
                        break;
                case PUSH_WHEEL:
                case PUSH_WHEEL_2:
                        sessionStorage.setItem('selectedRoute', JSON.stringify(listContents[currendIndex]));
                        sessionStorage.setItem('selectedIndexRoute', currendIndex);

                        callNextDialog();
                        break;
                case BACK:
                        if (!isFirstPage)
                                history.back();
                        break;
                case SK_NW:
                        leftTopSoftKey();
                        break;
                case SK_NE:
                        rightTopSoftKey();
                        break;
                case SK_SW:
                case SK_SW_2:
                        leftBottomSoftKey();
                        break;
                case SK_SE:
                case SK_SE_2:
                        rightBottomSoftKey();
                        break;
                case VOLUME_UP:
                        break;
                case VOLUME_DOWN:
                        break;
                case PTT:
                        startSpeechInput();
                        break;
                default:
                        console.info('unkown key pressed. ignoring: ' + e.keyCode);
                        break;
        }
}

function injectListContents(funcName) {
        var innerHTML = '';
        var startIndex = currendIndex - (currendIndex % entriesPerPage);
        var endIndex = Math.min(listContents.length, startIndex+entriesPerPage);
        for (var i=startIndex; i<endIndex; i++) {
                var isSelected = currendIndex === i ? true : false;
                innerHTML += window[funcName](i, isSelected);
        }
        document.getElementById('listItems').innerHTML = innerHTML;
}

function createListEntryStringConversation(i, isSelected) {
        var idSelected = isSelected === true ? ' id="listItemSelected"' : '';
        var ret;

						ret = '<div' + idSelected + ' class="listItem">' +
                                        '<img class="followMailLinkImg" src="./Audi_MMI_Files/media/link2.png" />' +
                                        '<div class="mailFirstLine">' + 
                                                '<span>' + listContents[i].routeName +
                                                  '<span style="position:absolute; left:305px;">' + getStarImage(listContents[i].avgRating) + '</span>' + 
                                                  '<span style="position:absolute; left:550px;">' + listContents[i].distToStart + '</span>' +
												 
                                                '</span>' +
                                        '</div>' +
                                '</div>';		
			
			

		
        return ret;
}